import pandas as pd
from flask import Flask, render_template


def info():
    df = pd.read_csv("data/中国疫情.csv")
    area = df['地区'].tolist()
    all = df['累计'].tolist()
    crue = df['治愈'].tolist()
    return area, all, crue


app = Flask(__name__)
picl = info()


@app.route("/")
def index():
    # 渲染模板的同时将数据传输进去
    return render_template("疫情基础条形图.html", picl=picl)


if __name__ == '__main__':
    app.run(debug=True)
